﻿<#if sp??>
	<#if sp.type == 0 || sp.type == 1>
		<#assign saleType = 0>
	<#else>
		<#assign saleType = 1>
	</#if>
</#if>
<!doctype html>
<html>
<head>
<#include "/part_meta.ftl">
<title>满额促销-迈小众</title>
<link href="${st.resDomain}/css/style.css" rel="stylesheet">
<link href="${st.resDomain}/css/form-base.css" rel="stylesheet">
<link href="${st.resDomain}/css/MC-base.css" rel="stylesheet">
<link href="${st.resDomain}/css/MC.css" rel="stylesheet">
</head>

<body>
<!--- header --->
<div id="header">
  <div class="main f_clear">
  	<div class="logo"><h2><@shiro.principal property="s_name" /></h2><span>您好！<@shiro.principal property="m_name" />， <a href="${st.domain}/member/logoutDo">退出</a>&nbsp;&nbsp;&nbsp;[ <a href="${st.shopDomain}/localSale/v1.1" target="_blank">进行线下销售</a> ]</span></div>
    <div class="f_right"><a href="${st.userDomain}">个人中心</a> <a href="${st.shopDomain}" class="selected">店铺管理</a><@shiro.hasRole name="FIRM"><a href="${st.firmDomain}">企业管理</a></@shiro.hasRole></div>
  </div>
</div>
<!--- header end--->
<!--topnav -->
<div id="topnav">
  <div class="main">
    <ul class="left">      
      
      <li><a href="${st.shopDomain}/order/list?statuses=0">订单</a></li>
      <li class="selected"><a href="${st.shopDomain}/storeGoods/list">商品</a></li>
      <li><a href="${st.shopDomain}/memberVip">会员</a></li>      
      <li><a href="${st.shopDomain}/store/edit">店铺</a></li>      
      <li><a href="${st.shopDomain}/goodsReport">数据</a></li>
    </ul>
  </div>
</div>
<!--topnav end-->
<div id="main" class="f_clear">
  <div id="left">
    <ul id="menu1">
      <li><a href="${st.shopDomain}/storeGoods/list">店铺商品</a></li>
      <li><a href="${st.shopDomain}/store/onlineSetting">线上销售</a></li>
      <li style="margin-left:10px;"><a href="${st.shopDomain}/goodsPromote/list?id.type=0">商品促销</a></li>
      <li <#if saleType == 0>class="selected"</#if> style="margin-left:10px;"><a href="${st.shopDomain}/storePromote/list?type=0">满额促销</a></li>
      <li><a href="${st.shopDomain}/store/localSetting">线下销售</a></li>
      <li style="margin-left:10px;"><a href="${st.shopDomain}/goodsPromote/list?id.type=2">商品促销</a></li>
      <li <#if saleType == 1>class="selected"</#if> style="margin-left:10px;"><a href="${st.shopDomain}/storePromote/list?type=2">满额促销</a></li>
      
      <li style="margin-left:10px;"><a href="${st.shopDomain}/localSale/soft">离线版本</a></li>
      <li><a href="${st.shopDomain}/storeRestock/list?isChecked=0">进货管理</a></li>
      <li><a href="${st.shopDomain}/storeGoods/add">商品入库</a></li>
    </ul>
  </div>
  <div id="right">
    <div id="title"><#if saleType == 0>线上<#else>线下</#if>销售 - 满额促销 - <#if sp??>编辑<#else>新增</#if></div>
    <div id="cxhd">
    <form id="promoteForm" autocomplete="off">
      <div class="form val">
      	<p style="display:none;">
      		<input id="promoteId" name="promoteId" type="hidden" value="${sp.promoteId}"/>
      	</p>
        <p>
          <label>促销名称：<em>*</em></label>
          <input name="name" type="text" value="${sp.name}"/>
        </p>
        <p>
          <label>促销类型：<em>*</em></label>
          <select id="type" name="type" <#if sp.type??>disabled</#if>>
          	<#if saleType == 0>
            <option value="0" <#if sp.type == 0 >selected</#if>>满减</option>
            <option value="1" <#if sp.type == 1 >selected</#if>>满赠</option>
            <#else>
            <option value="2" <#if sp.type == 2 >selected</#if>>满减</option>
            <option value="3" <#if sp.type == 3 >selected</#if>>满赠</option>
            </#if>
          </select>
        </p>
        <p style="display:none">
          <label>商品类目：</label>
          <select>
            <option>青秀区</option>
          </select>
        </p>
        <p class="s">
          <label>订单金额：<em>*</em></label>
          <input name="cost" type="text" value="${sp.cost}"/><span>￥</span>
        </p>
        <div id="itemType_<#if saleType == 0>0<#else>2</#if>" style="display:none;">
        <p class="s">
          <label>满减金额：<em>*</em></label>
          <input id="back" name="back" type="text" value="${sp.back}"/><span>￥</span>
        </p>
        <p class="f_clear">
          <label>类推：</label>
          <span class="dx">
          <input name="isAnalogy" type="radio" value="0" <#if !sp.isAnalogy >checked</#if>>
            <font>否</font>
          <input name="isAnalogy" type="radio" value="1" <#if sp.isAnalogy >checked</#if>>
            <font>是</font></span> </p>
        <div id="analogize" style="display:none;">
         <p class="s">
          <label>类推订单金额：<em>*</em></label>
          <input id="analogyCost" name="analogyCost" type="text" value="${sp.analogyCost}"/><span>￥</span>
         </p>
         <p class="s">
          <label>类推满减金额：<em>*</em></label>
          <input id="analogyBack" name="analogyBack" type="text" value="${sp.analogyBack}"/><span>￥</span>
         </p>
        </div>
        </div>
        <div id="itemType_<#if saleType == 0>1<#else>3</#if>" style="display:none;">
        <p>
        <label>赠送商品：<em>*</em></label>
        <span id="giftctrl_0" style="display:none;">
        	<span style="float:left; padding-left:5px">还可以添加 <b id="giftRemain">0</b> 种商品</span>
        	<a href="javascript:;" id="giftEditBt" style="color: #06C;">设置</a>
        	<input type="hidden" id="giftAmount" value="<#if sp??>${sp.storeGifts?size}</#if>">
        	<span for="giftAmount" class="msg-box n-right" style="margin-left: 30px;min-width:200px;" ></span>
        	</span>
        <span id="giftctrl_1" style="width:400px;display:none;">
        	<input type="text" id="giftSearchWord" placeholder="商品名称/编码" style="width:150px;">
        	<a href="javascript:;" id="giftSearchBt" class="btn3" style="width:25px;float:left;">查找</a>
        	<a href="javascript:;" id="giftFinishBt" class="btn2" style="float:right;">完成</a></span>
        </p>
        <table width="500" border="0" cellspacing="0" cellpadding="0" id="zssp">
        <#list sp.storeGifts as sg>
        <#assign g = sg.storeGoods >
          <tr>
		  	<td class="ch"><input type="checkbox" id="giftCh_${sg.id.storeGoodsId}" value="${sg.id.storeGoodsId}" checked>&nbsp;</td>
		    <td class="sp">
		    	<a href="javascript:;"><img src="${st.resDomain}/images/goods_def.jpg" <#if sg.storeGoods.pic??>data="${sg.storeGoods.pic}"</#if>>
		    	<span>${g.barCode}<br>${g.name}</span></a></td>
		    <td width="100">库存：${g.stockConvert}<#if g.sellUnit?? >${g.sellUnit}<#else>${g.unit}</#if></td>
		    <td width="100">送：<span id="giftAmountR_${sg.id.storeGoodsId}" style="display:none;">${sg.amount}</span>
		    <input id="giftAmountW_${sg.id.storeGoodsId}" type="text" value="${sg.amount}" data-rule="required;amount">
		    <span><#if g.sellUnit?? >${g.sellUnit}<#else>${g.unit}</#if></span> <span for="giftAmountW_${sg.id.storeGoodsId}" class="msg-box"></span></td>
		  </tr>
        </#list>
		</table>
		<div id="giftPage" class="tabletj" style="padding-top:2px;height:30px;width:600px;">
	      <div id="page">
	        <ul>
	          <li><span>共 <span id="totalPage" style="float: none; display: inline-block;">0</span> 页 <span id="totalResult" style="float: none; display: inline-block;">0</span> 个商品</span></li>
	          <li class="prv"><a href="javascript:;"></a></li>
	          <li class="selected"><a href="javascript:;" id="nowPage">0</a></li>
	          <li class="next"><a href="javascript:;"></a></li>
	        </ul>
	      </div>
	    </div>
        <p>
          <label>自动下撤：<em>*</em></label>
          <span class="dx">
          <input name="autoOut" type="radio" value="1" <#if sp.autoOut || !sp.autoOut??>checked</#if>>
            <font>开</font>
          <input name="autoOut" type="radio" value="0" <#if sp.autoOut?? && !sp.autoOut >checked</#if>>
            <font>关</font></span>
        </p>
        <p class="zs">
          当赠送商品无库存时，从赠送列表中移除
        </p>
        </div>
        <p class="xldx">
            <label>活动时间：<em>*</em></label>
            <span><input name="timeType" type="radio" value="0" checked>今天</span>
            <span><input name="timeType" type="radio" value="1">本周</span>
            <span><input name="timeType" type="radio" value="2">自定义</span>
        </p>  
        <p class="xldx">
          <label>&nbsp;</label>
          <span>从</span>
          <input type="text" id="stPicker" value="" 
          	onFocus="var etPicker=$dp.$('etPicker');WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',readOnly:true,minDate:'%y-%M-%d %H:%m:%s',startDate:'%y-%M-%d %H:%m:%s',errDealMode:1,onpicked:function(){$('#stPicker').blur();etPicker.value='',etPicker.focus();}})" readonly disabled class="Wdate" style="width:130px"/>
          <input id="startTime" name="startTime" type="hidden" value="${sp.startTime}"/>
          <span id="stMsg"></span>
          <span>到</span>
          <input type="text" id="etPicker" value="" 
          	onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',readOnly:true,minDate:'#F{$dp.$D(\'stPicker\')}',startDate:'#F{$dp.$D(\'stPicker\')}',errDealMode:1,onpicked:function(){$('#etPicker').blur();}})" readonly disabled class="Wdate" style="width:130px"/>
          <input id="endTime" name="endTime" type="hidden" value="${sp.endTime}"/>
        </p>
      </div>
      <div class="Submit f_clear">
      <input type="submit" id="submitBt_0" onclick="return false;" class="feignhide"><!-- 实现回车提交 -->
      <a href="javascript:;" id="submitBt_1" class="btn1"><i></i><em>确定</em></a><a id="cancelBt" class="btn1b"><i></i><em>返回</em></a><a id="delBt" style="text-decoration:underline;line-height:28px;height:28px;">删除</a></div>
    </form>
    </div>
  </div>
</div>
<!--footer-->
<div id="footer">Copyright© 迈小众 <span style="padding-left:30px;">客服QQ：<a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=3101084438&site=qq&menu=yes" rel="nofollow"><img border="0" src="http://wpa.qq.com/pa?p=2:3101084438:50" alt="点击联系我们，QQ：3101084438" title="点击联系我们，QQ：3101084438"></a></span></div>
<!--footer end-->
<script data-main="${st.resDomain}/scripts/shop/storePromote_addOrEdit" src="${st.resDomain}/scripts/require.js"></script>
</body>
</html>
